﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Security;
using Telecom.Data;

namespace TelecomGis.Helper.MemberS
{
    public class UserMapping
    {
        public static MembershipUser CreateMembershipUser(string appName, USERS user)
        {
            if (user != null)
            {
                return new MembershipUser(appName, user.USERNAME, user.USERID, "", null, null, true, true,
                    DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now);
            }
            return null;
        }

        public static MembershipUserCollection CreateMembershipUser(string appName, List<USERS> userList)
        {
            MembershipUserCollection users = new MembershipUserCollection();

            foreach (USERS user in userList)
            {
                MembershipUser mUser = CreateMembershipUser(appName, user);
                users.Add(mUser);
            }

            return users;
        }
    }
}
